<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="b2ContactListener,Box2D.Dynamics.b2ContactListener,BeginContact,EndContact,PostSolve,PreSolve" name="keywords">
<title>Box2D.Dynamics.b2ContactListener</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'b2ContactListener - Box2DFlash Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Box2DFlash Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?Box2D/Dynamics/b2ContactListener.html&amp;Box2D/Dynamics/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;b2ContactListener</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class b2ContactListener"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">Box2D.Dynamics</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class b2ContactListener</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Source</td><td><a href="http://box2dflash.svn.sourceforge.net/viewvc/box2dflash/Source/Box2D/Dynamics/b2ContactListener.as">b2ContactListener.as</a></td>
</tr>
</table>
<p></p>
 Implement this class to get contact information. You can use these results for
 things like sounds and game logic. You can also get contact results by
 traversing the contact lists after the time step. However, you might miss
 some contacts because continuous physics leads to sub-stepping.
 Additionally you may receive multiple callbacks for the same contact in a
 single time step.
 You should strive to make your callbacks efficient because there may be
 many callbacks per time step.
 <p>
<font color="red">Warning: </font>You cannot create/destroy Box2D entities inside these callbacks.
 </p>
<p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#BeginContact()">BeginContact</a>(contact:<a href="Contacts/b2Contact.html">b2Contact</a>):void</div>
<div class="summaryTableDescription">
  Called when two fixtures begin to touch.</div>
</td><td class="summaryTableOwnerCol">b2ContactListener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#EndContact()">EndContact</a>(contact:<a href="Contacts/b2Contact.html">b2Contact</a>):void</div>
<div class="summaryTableDescription">
  Called when two fixtures cease to touch.</div>
</td><td class="summaryTableOwnerCol">b2ContactListener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#PostSolve()">PostSolve</a>(contact:<a href="Contacts/b2Contact.html">b2Contact</a>, impulse:<a href="b2ContactImpulse.html">b2ContactImpulse</a>):void</div>
<div class="summaryTableDescription">
  This lets you inspect a contact after the solver is finished.</div>
</td><td class="summaryTableOwnerCol">b2ContactListener</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#PreSolve()">PreSolve</a>(contact:<a href="Contacts/b2Contact.html">b2Contact</a>, oldManifold:<a href="../Collision/b2Manifold.html">b2Manifold</a>):void</div>
<div class="summaryTableDescription">
  This is called after a contact is updated.</div>
</td><td class="summaryTableOwnerCol">b2ContactListener</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="BeginContact()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">BeginContact</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function BeginContact(contact:<a href="Contacts/b2Contact.html">b2Contact</a>):void</code><p>
  Called when two fixtures begin to touch.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">contact</span>:<a href="Contacts/b2Contact.html">b2Contact</a></code></td>
</tr>
</table>
</div>
<a name="EndContact()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">EndContact</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function EndContact(contact:<a href="Contacts/b2Contact.html">b2Contact</a>):void</code><p>
  Called when two fixtures cease to touch.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">contact</span>:<a href="Contacts/b2Contact.html">b2Contact</a></code></td>
</tr>
</table>
</div>
<a name="PostSolve()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">PostSolve</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function PostSolve(contact:<a href="Contacts/b2Contact.html">b2Contact</a>, impulse:<a href="b2ContactImpulse.html">b2ContactImpulse</a>):void</code><p>
  This lets you inspect a contact after the solver is finished. This is useful
  for inspecting impulses.
  Note: the contact manifold does not include time of impact impulses, which can be
  arbitrarily large if the sub-step is small. Hence the impulse is provided explicitly
  in a separate data structure.
  Note: this is only called for contacts that are touching, solid, and awake.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">contact</span>:<a href="Contacts/b2Contact.html">b2Contact</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">impulse</span>:<a href="b2ContactImpulse.html">b2ContactImpulse</a></code></td>
</tr>
</table>
</div>
<a name="PreSolve()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">PreSolve</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function PreSolve(contact:<a href="Contacts/b2Contact.html">b2Contact</a>, oldManifold:<a href="../Collision/b2Manifold.html">b2Manifold</a>):void</code><p>
  This is called after a contact is updated. This allows you to inspect a
  contact before it goes to the solver. If you are careful, you can modify the
  contact manifold (e.g. disable contact).
  A copy of the old manifold is provided so that you can detect changes.
  Note: this is called only for awake bodies.
  Note: this is called even when the number of contact points is zero.
  Note: this is not called for sensors.
  Note: if you set the number of contact points to zero, you will not
  get an EndContact callback. However, you may get a BeginContact callback
  the next step.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">contact</span>:<a href="Contacts/b2Contact.html">b2Contact</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">oldManifold</span>:<a href="../Collision/b2Manifold.html">b2Manifold</a></code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">Box2DFlash 2.1a</center>
</div>
</body>
</html>
<!--Box2DFlash 2.1a-->
